<%--
  Created by IntelliJ IDEA.
  User: limin
  Date: 2021/8/8
  Time: 15:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">

    <title></title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">

    <link rel="stylesheet" type="text/css" href="css/edittable.css"  >
    <link rel="stylesheet" type="text/css" href="css/validate.css"  >
    <script type="text/javascript"  src="js/jquery-1.8.0.js"></script>
    <script>
        $(function(){
            $("input[type=text],textarea").focus(function(){
                $(this).addClass("input_focus");
            }).blur(function(){
                $(this).removeClass("input_focus");
            });

            $(".form_btn").hover(function(){
                    $(this).css("color","red").css("background","#6FB2DB");
                },

                function(){
                    $(this).css("color","#295568").css("background","#BAD9E3");
                });
        });
    </script>

</head>

<body>
<div class ="div_title">
    <div class="div_titlename"> <img src="images/san_jiao.gif" ><span>用户角色分配</span></div>
</div>
<form action="RoleServlet.do?flag=doassignment" method="post">
    <table class="edit_table">
        <tr>
            <td class="td_info">用户账号</td>
            <td>
                <input type="hidden" name="id" value="${adminInfo.id}">${adminInfo.id}
                <label>${adminInfo.adminName}</label>
            </td>
        </tr>
        <tr>
            <td class="td_info">用户角色</td>
            <td>
                <c:forEach var="r" items="${roleList}">
                    <c:choose>
                        <c:when test="${adminInfo.roleId == r.id}">
                            <input type="radio" name="roleId" id="roleId" value="${r.id}" checked>${r.roleName}  ${r.id}<br>
                        </c:when>
                        <c:otherwise>
                            <input type="radio" name="roleId" id="roleId" value="${r.id}" >${r.roleName}  ${r.id}<br>
                        </c:otherwise>
                    </c:choose>
                </c:forEach>
            </td>
        </tr>
        <tr>
            <td class="td_info"></td>
            <td>
                <input type="submit" id="sub1" value="提交" class="form_btn">

                <a href="RoleServlet.do?flag=listadmin">
                    <input type="button" value="返回" class="form_btn">
                </a>
            </td>
        </tr>
    </table>
</form>
${msg}
</body>

</html>
